<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查询天气</title>
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/index.css">
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div class="wrap" id="app">
        <header class="header">
            <h1>小朋友查天气</h1>
        </header>
        <section class="main">
            <section class="search">
                <input type="text" placeholder="请输入查询的城市" v-model='city' @keyup.enter='search'>
                <span class="btn" @click="search">搜索</span>
            </section>

            <section class="common-use">
                <a href="javascript:;" @click="changeCity('北京')">北京</a>
                <a href="javascript:;" @click="changeCity('上海')">上海</a>
                <a href="javascript:;" @click="changeCity('广州')">广州</a>
                <a href="javascript:;" @click="changeCity('深圳')">深圳</a>
            </section>

            <section class="weather">
                <ul>
                    <li v-for='item in forecast'>
                        <div>
                            <h1>{{item.type}}</h1>
                            <p>{{item.low}} ~ {{item.high}}</p>
                            <p>{{item.date}}</p>
                        </div>
                    </li>
                </ul>
            </section>
        </section>
    </div>
    <script src="./js/main.js"></script>
</body>

</html>